﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntLibSample.BLL;
using EntLibSample.EntityModel;
using EntLibSample.DALCommon;

namespace EntLibSample
{
    public partial class Default : BasePage //System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
            BindAddressList();
		}

        private void BindAddressList()
        {
            BLLAddress bllAddress = new BLLAddress();
            List<Address> addressList = bllAddress.GetAllAddress();
            grdAddress.DataSource = addressList;
            grdAddress.DataBind();
        }

        protected void grdAddress_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            grdAddress.PageIndex = e.NewPageIndex;
            BindAddressList();
        }
	}
}